import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router);

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      redirect: '/overview'
    },
    {
      path: '/overview',
      name: 'overview',
      component: () => import('../pages/overview/overview.vue'),
      meta: {
        title: '库存总览',
        requireAuth: true
      }
    },    // 库存总览
    {
      path: '/init-stock',
      name: 'initStock',
      component: () => import('../pages/initStock/initStock.vue'),
      meta: {
        title: '初始化库存',
        requireAuth: true,
        requireAdmin: true
      }
    },    // 初始化库存
    {
      path: '/usermanage',
      name: 'usermanage',
      component: () => import('../pages/usermanage/usermanage.vue'),
      meta: {
        title: '人员管理',
        requireAuth: true,
        requireAdmin: true
      }
    },    // 人员管理
    {
      path: '/login',
      name: 'login',
      component: () => import('../pages/login/login.vue'),
      meta: {
        name: 'login',
        title: '登录'
      }
    },    // 登录页面
  ]
})
